import 'package:flutter/material.dart';

void alert(
  BuildContext context,
  {
    String title='警告',
    String msg='错误',
    String okText='确定',
  }
){
  showDialog(
    context: context,
    builder: (context)=>AlertDialog(
      title: Center(
        child: Text(title)
      ),
      content: Text(msg),
      actions: [
        FlatButton(
          child: Text(okText),
          color: Colors.blue,
          onPressed: (){
            Navigator.pop(context);
          },
        ),
      ],
    )
  );
}